#pragma once
#include "include.h"

class CBaseIni
{
public:
	CBaseIni();
	CBaseIni( cstr_t lpszFileName );
public:
	~CBaseIni(void);
public:
	void   Ini( cstr_t lpszFileName );
	bool   WriteStr( cstr_t lpszAppName, cstr_t lpszKeyName, cstr_t lpszString/*, cstr_t lpszFileName = NULL*/ );
	bool   WriteStruct( cstr_t lpszAppName, cstr_t lpszKeyName, void * pStruct, uint32 nSizeStruct );
	bool   WriteInt( cstr_t lpszAppName, cstr_t lpszKeyName, int nValue );

	uint32 ReadStr( cstr_t lpszAppName, cstr_t lpszKeyName, cstr_t lpDefault, string_t & strValue/*, cstr_t lpszFileName = NULL*/ );
	int32  ReadInt( cstr_t lpszAppName, cstr_t lpszKeyName, int32 nDefault/*, cstr_t lpszFileName = NULL*/ );
	int64  ReadInt64( cstr_t lpszAppName, cstr_t lpszkeyName, int64 nDefault );
	bool   ReadStruct( cstr_t lpszAppName, cstr_t lpszKeyName, void * pStruct, uint32 nSizeStruct );

	int    GetAllSectionNames( char_t * pBuf, int nBuflen );
public:
	string_t m_strFileName;
};
